<template>
  <div >
    <a :style="{ width: width, color: textColor }" class="btn">{{ text }}</a>
  </div>
</template>
<script setup lang="ts">
const props = defineProps({
  text: {
    default: "button" as string,
  },
  textColor: {
    default: "white" as string,
  },
  width:{
    default:'100px' as string
  },
});

</script>
<style scoped lang="less">
.btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 16px;
  color: #08c913;
  font-weight: 700;
  border: 3px solid rgb(252, 70, 100);
  cursor: pointer;
  position: relative;
  background-color: transparent;
  text-decoration: none;
  overflow: hidden;
  z-index: 1;
  font-family: inherit;
}

.btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(252, 70, 100);
  transform: translateX(-100%);
  transition: all 0.3s;
  z-index: -1;
}

.btn:hover::before {
  transform: translateX(0);
}
</style>